package com.scs.application.modules.sys.controller;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.scs.application.modules.sys.model.RestResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.scs.application.core.mvc.controller.CrudController;
import com.scs.application.modules.sys.service.AppraiseService;
import com.scs.application.modules.sys.entity.Appraise;

/**
 */
@RestController
@RequestMapping("/sys/appraise")
public class AppraiseController extends CrudController<AppraiseService, Appraise>{

    @GetMapping("getOne")
    public RestResult getAppraise() {
        Appraise appraise = service.getOne(Wrappers.<Appraise>query().orderByDesc("bus_date").last("limit 1"));
        return RestResult.ok("获取数据成功", appraise);
    }
}
